package chap3_7;

import java.io.*;

/**
 * @author https://gitee.com/W_Jun
 * @date 2021-12-13 21:38
 * @Description
 */
public class CopyJavaDemo02 {
    public static void main(String[] args) throws IOException {
        FileReader fr = new FileReader("chapter03-字符流\\src\\chap3_4\\ConversionStreamDemo.java");
        FileWriter fw = new FileWriter("chapter03-字符流\\Copy.java");
        //一次读写一个字符
/*
        int ch;
        while ((ch = fr.read()) != -1) {
            fw.write(ch);
        }
*/
        //一次读写一个字符数组
        int len;
        char[] chs = new char[1024];
        while ((len = fr.read(chs)) != -1) {
            fw.write(chs, 0, len);
        }
        fw.close();
        fr.close();
    }
}
